/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/21 18:16
  *
  * @file       pd_i2c.c
  * @brief      I2C hardware driver.
  *
  * @note       This file contains the hardware driver for the I2C.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date          Author       Notes
  *   2024/6/21     Chris        the first version
  *
  ******************************************************************************
  */


#include "pd_i2c.h"
#include <assert.h>

static void I2C_init_(const I2C *this) {
    assert(0);
}

static uint8_t I2C_send_(const I2C *this, uint8_t salveAddress, uint16_t regAddress, uint8_t *dat, uint8_t len) {
    assert(0);
    return 0;
}

static uint8_t I2C_read_(const I2C *this, uint8_t salveAddress, uint16_t regAddress, uint8_t *dat, uint8_t len) {
    assert(0);
    return 0;
}

void I2C_constructor(I2C *this, GPIO *sck, GPIO *sda) {
    static struct I2CVtbl vtbl = {
        .init = &I2C_init_,
        .send = &I2C_send_,
        .read = &I2C_read_,
    };

    this->vptr = &vtbl;
    this->sck = sck;
    this->sda = sda;
}
